const getValueByIndex=(str, index)=>{
    const arr = str.split('|');
    console.log(arr,"arr")
    if(index<arr.length){
        return arr[index];
    }else{
        return "";
    }
}

console.log(getValueByIndex("aaa|bbb|ccc|",2))

//node ./src/pages/finger_device/test.ts